package com.site.util.fck;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter;
//升级到struts2.3.14，xwork安全问题
public class FckPassFilter extends StrutsPrepareAndExecuteFilter {
	@Override
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
		HttpServletRequest request = (HttpServletRequest) req;
		if ("/fckeditor/editor/filemanager/connectors".equals(request.getServletPath())) {
			//System.out.println("发现fck路径，绕过struts2过滤器");
			chain.doFilter(req, res);
		} else {
			super.doFilter(req, res, chain);
		}
	}

}
